package com.gao.feign;

import com.gao.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@FeignClient(name = "PROVIDER-DEPT",fallbackFactory = FeignDeptFallback.class)
@Service
public interface FeignDept {

    @GetMapping("/dept/get/{id}")
    public Dept getDeptById(@PathVariable(name = "id") Integer id);

    @GetMapping("/dept/get/list")
    List<Dept> getDeptAll();

    @PostMapping("/dept/add")
    boolean addDept(Dept dept);

}
